package com.ByteDance.model.vo;

import com.ByteDance.model.po.UserInfos;
import com.ByteDance.utils.StatusConstant;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Setter;


@Data
@ApiModel(description = "用户信息VO实体")
public class UserInfosVO {

    @Setter(onMethod_ = {@JsonProperty("status_code")})
    @ApiModelProperty("状态码，0-成功，其他值-失败")
    private Integer statusCode;

    @Setter(onMethod_ = {@JsonProperty("status_msg")})
    @ApiModelProperty("状态描述")
    private String statusMsg;

    @Setter(onMethod_ = {@JsonProperty("user")})
    @ApiModelProperty("用户信息")
    private User user;


    public static UserInfosVO success(){
        UserInfosVO userInfosVO = new UserInfosVO();
        userInfosVO.setStatusCode(StatusConstant.StatusEnum.SUCCESS.getCode());
        userInfosVO.setStatusMsg(StatusConstant.StatusEnum.SUCCESS.getMsg());
        return userInfosVO;
    }

    public static UserInfosVO fail(){
        UserInfosVO userInfosVO = new UserInfosVO();
        userInfosVO.setStatusCode(StatusConstant.StatusEnum.FAIL.getCode());
        userInfosVO.setStatusMsg(StatusConstant.StatusEnum.FAIL.getMsg());
        return userInfosVO;
    }
}
